package com.citycloud.ccuap.tc.admin.entity;

import com.citycloud.ccuap.framework.service.Model;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mybatis.annotations.Column;
import org.springframework.data.mybatis.annotations.Condition;
import org.springframework.data.mybatis.annotations.Conditions;
import org.springframework.data.mybatis.annotations.Entity;
import org.springframework.data.mybatis.annotations.Id;
import org.springframework.data.repository.query.parser.Part;

import java.util.Date;

import static org.springframework.data.mybatis.annotations.Id.GenerationType.ASSIGNATION;

/**
 * 数据库脚本更新记录表实体对象
 *
 */
@Data
@NoArgsConstructor
@Entity(table = "sys_db_update")
public class SysDbUpdate implements Model {
	private static final long serialVersionUID = 1L;
	
	@Id(strategy = ASSIGNATION)
	@Column(name = "sql_name")
	@Condition(type = Part.Type.LIKE)
	private String sqlName;
	
	@Column(name = "sql_content")
	@Condition(type = Part.Type.LIKE)
	private String sqlContent;
	
	@Column(name = "execute_time")
	@Conditions({ 
		@Condition,
		@Condition(type = Part.Type.GREATER_THAN_EQUAL, properties="startExecuteTime"), 
		@Condition(type = Part.Type.LESS_THAN, properties="endExecuteTime") 
	})
	private Date executeTime;
	


}